Skip to content

Create tsunami module#324

Open
joewallwork wants to merge 3 commits into
mainfrom
tsunami
Open

Create tsunami module#324
joewallwork wants to merge 3 commits into
mainfrom
tsunami

Conversation

@joewallwork

Copy link
Copy Markdown
Contributor

Minor update that's been on my to do list for a while: create a Thetis module for the tsunami utils. Would allow us to consider tsunamis other than Tohoku and will also allow me to write a Tohoku demo (also on the to do list).

@joewallwork joewallwork requested a review from tkarna September 30, 2022 08:08
stephankramer
stephankramer previously approved these changes Feb 29, 2024

@stephankramer stephankramer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jwallwork23 : still planning to add more tsunami cases? In any case this seems to move a module from an example to thetis/ - which looks fine to me.

@joewallwork

Copy link
Copy Markdown
Contributor Author

@jwallwork23 : still planning to add more tsunami cases? In any case this seems to move a module from an example to thetis/ - which looks fine to me.

Thanks. No plans to do any tsunami modelling in the near future myself.

@joewallwork

Copy link
Copy Markdown
Contributor Author

[Merged master into this branch to fix conflicts.]

@stephankramer

Copy link
Copy Markdown
Contributor

@joewallwork : same here. If you still want to proceed could you resolve conflicts, or otherwise close it? On the surface looks to be a useful change, but understand if you don't have the time for it now.

@joewallwork

Copy link
Copy Markdown
Contributor Author

@joewallwork : same here. If you still want to proceed could you resolve conflicts, or otherwise close it? On the surface looks to be a useful change, but understand if you don't have the time for it now.

Seemed like a straightforward merge - let's see what the CI says.

@joewallwork joewallwork requested a review from stephankramer June 4, 2026 15:42
Comment thread thetis/tsunami.py
R = self.rotation_matrix()
x, y = ufl.dot(R, X)
L, W = self.fault_length, self.fault_width
cond = ufl.And(ufl.And(x > -L / 2, x < L / 2), ufl.And(y > -W / 2, y > W / 2))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cond = ufl.And(ufl.And(x > -L / 2, x < L / 2), ufl.And(y > -W / 2, y < W / 2))

Just playing around with AI, and it points me at what looks like a serious bug that was already there... I'm a little confused: has it been applying the source in completely the wrong place? Previously it would have been only applied where y > W/2, so above the rectangle?

Comment thread thetis/tsunami.py
def strike_slip(y1, y2):
d_bar = y2 * sn - q * cs
r = sqrt(y1**2 + y2**2 + q**2)
a4 = 2 * poisson * (ln(r + d_bar) - sn * ln(r + y2)) / cs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another AI observation: we're dividing here by cs, cosine of the dip, but in the OkadaArrayTsunamiSource, we bound 0<=dip<=90 so in an optimisation it's allowed to have dip=90 which would blow things up. Might well be that this is fine, if that in fact means the optimisation will steer things away from dip=90.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants